<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<div class="t_bar">${param.title4 }</div>
<table class="t_css table01" width="100%" border="0" cellpadding="0" id="orgCooperationInfo" cellspacing="1">
	 	 <col width ="20%"/>
		 <col width ="15%"/>
		 <col width ="12%"/>
		 <col width ="23%"/>
		 <col width ="15%"/>
		 <col width ="15%"/>
	<tr >
		<td align="right">是否开展产学研活动：</td>
		<td>
			<span name="organization/whether_industrial_activity_name">
			<x:out select="$xmlData/data/organization/whether_industrial_activity_name"/>
			</span>
		</td>
		<td align="right">合作方区域：</td>
		<td>
			<span name="organization/cooperation_area_name">
			<x:out select="$xmlData/data/organization/cooperation_area_name"/>
			</span>
		</td>
		<td align="right">合作经费（万元）：</td>
		<td align="center">
			<span name="organization/cooperation_fund">
			<x:out select="$xmlData/data/organization/cooperation_fund"/>
			</span>
		</td>
	</tr>
</table>
<div class="t_bar">合作单位（最多三家）</div>
<table  id="orgCooperationUnitInfo" cellpadding="0" class="t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<col style="width: 5%"/>
	<col style="width: 40%"/>
	<col style="width: 55%"/>
	<thead >
	<tr style="border:1px solid #B7D1E6">
		<th class="TblHead" align="center">名称</th>
		<th class="TblHead" align="center">单位名称</th>
		<th class="TblHead" align="center"><span class="color_red">*</span>合作经费(万元)</th>
	</tr>
	</thead>
	<tbody id="tab">
	<tr style="display:none">
		<td align="center">
			<span name="product|org[0]@sequence_no" >[index]</span>
		</td>
		<td align="center">
			<span name="product|org[0]@gname" >[index]</span>
		</td>
		<td align="center">
			<input type="text" name="product|org[0]|coop_fund_expend" class="input_text required " style="width:80%" label="合作单位-->第${index+1}行合作经费" value=""/>
		</td>
	</tr>
	<c:if test="${is_first==1}">
	<c:set value="0" var="index" scope="page"/>
	<x:forEach select="$xmlData/data/product/org" var="productOrg">

		<c:choose>
			<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
			<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
		</c:choose>
		<tr >
			<td align="center">
				<span   name="cooperation/org[${flag}${index}]@sequence_no" ><x:out select="$productOrg/@sequence_no"/></span>
			</td>

			<td align="center">
				<span   name="cooperation/org[${flag}${index}]/gname" ><x:out select="$productOrg/gname" /></span>
			</td>
			<td align="center">
				<input type="text" name="cooperation/org[${flag}${index}]/coop_fund_expend" value="<x:out select="$productOrg/coop_fund_expend" />" class="input_text required" style="width:80%;text-align: right;" label="合作单位-->第${index+1}行合作经费 " onfocus="InitInput.setNumber(this,7,2,2)" maxlength="50"/>
			</td>
		</tr>
		<c:set value="${index+1}" var="index" scope="page"/>
	</x:forEach>
	</c:if>
	<c:if test="${is_first==0}">
		<c:set value="0" var="index" scope="page"/>
		<x:forEach select="$xmlData/data/cooperation/org" var="productOrg">

			<c:choose>
				<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
				<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
			</c:choose>
			<tr >
				<td align="center">
					<span   name="cooperation/org[${flag}${index}]@sequence_no" ><x:out select="$productOrg/@sequence_no"/></span>
				</td>

				<td align="center">
					<span   name="cooperation/org[${flag}${index}]/gname" ><x:out select="$productOrg/gname" /></span>
				</td>
				<td align="center">
					<input type="text" name="cooperation/org[${flag}${index}]/coop_fund_expend" value="<x:out select="$productOrg/coop_fund_expend" />" class="input_text required" style="width:80%;text-align: right;" label="合作单位-->第${index+1}行合作经费 " onfocus="InitInput.setNumber(this,7,2,2)" maxlength="50"/>
				</td>
			</tr>
			<c:set value="${index+1}" var="index" scope="page"/>
		</x:forEach>
	</c:if>
	</tbody>
</table>
<div class="t_bar">${param.title5 }</div>
<table class="t_css table01" width="100%" border="0" cellpadding="0" id="mainBusiness" cellspacing="1">
	<tr style="border:1px solid #B7D1E6"> 
		<th width="5%">序号</th>
		<th width="40%">主要产品名称</th>
		<th width="55%">领域</th>
	</tr>
	<c:set value="0" var="index" scope="page" />
		<x:forEach select="$xmlData/data/product/goods" var="goods">
				<c:choose>
					<c:when test="${index<10}">
						<c:set value="0" var="flag" scope="page" />
					</c:when>
					<c:otherwise>
						<c:set value="" var="flag" scope="page" />
					</c:otherwise>
				</c:choose>
			<tr align="left" >
				<td align="center" >
				<span name="product/goods[${flag}${index}]@sequence_no">
						<x:out select="$goods/@sequence_no" />
				</span>
					</td>									
					<td align="left" >
					<span name="product/goods[${flag}${index}]/gname">
						<x:out select="$goods/gname" />
					</span>
					</td>
					<td align="left" >
					<span name="product/goods[${flag}${index}]/field">
						<x:out select="$goods/field" />
					</span>
					</td>
			</tr>
		<c:set value="${index+1}" var="index" scope="page" />
		</x:forEach>				

</table>

<script>
	function synchronizationAmount(){
		var request_amount=$("#request_amount").val();
		if(request_amount !=  ""){
			$("#total_each_0").val(parseFloat($("#request_amount").val()).toFixed(2));
			$("#total_fund_18").val(parseFloat($("#request_amount").val()).toFixed(2));
		}else if(request_amount ==  ""){
			$("#total_each_0").val("");
			$("#total_fund_18").val("");
		}

	}

	function fund_compare() {


		/*  	var total_each =((parseFloat($("#total_each_0").val())*10000 + parseFloat($("#total_each_1").val())*10000 + parseFloat($("#total_each_2").val())*10000 + parseFloat($("#total_each_4").val())*10000)/10000).toFixed(4);
			  /!*var total_each =  (Number($("#total_each_0").val())*100 + Number($("#total_each_1").val())*100 + Number($("#total_each_2").val())*100+ Number($("#total_each_3").val())+ Number($("#total_each_4").val())*100)/100;*!/


			  $("#total_investfrom_5").val(  formatNumberAuto(total_each.toString(), 9, 4, 2));
		  }
	  */

		var ta1 = parseFloat($("#total_each_0").val());

		var ta2 = parseFloat($("#total_each_1").val());
		var ta3 = parseFloat($("#total_each_2").val());
		var ta4 = parseFloat($("#total_each_4").val());
		if (!$.isNumeric(ta1)) {
			ta1 = 0;
		}
		if (!$.isNumeric(ta2)) {
			ta2 = 0;
		}
		if (!$.isNumeric(ta3)) {
			ta3 = 0;
		}
		if (!$.isNumeric(ta4)) {
			ta4 = 0;
		}
		//var ta4 =(ta1+ta2+ta3)*0.1;
		//ta5 = ((parseFloat(ta4)*10000)/10000).toFixed(4);
		ta5 = ((parseFloat(ta1) * 10000 + parseFloat(ta2) * 10000 + parseFloat(ta3) * 10000 + parseFloat(ta4) * 10000) / 10000).toFixed(4);

		//var ta5 =$("#office_szwj_quota").val(ta4)*0.1;
		ta6 = formatNumberAuto(ta5.toString(), 9, 4, 2);
		//var ta =ta6*0.1;


		$("#total_investfrom_5").val(ta6);

	}
</script>
	
		
		
		
		
		